﻿using GameView.ViewModels;
using MaterialDesignThemes.Wpf;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace GameView.Views
{
    /// <summary>
    /// RechargeAddNewView.xaml 的交互逻辑
    /// </summary>
    public partial class RechargeAddNewView : UserControl
    {
        public RechargeAddNewView(RechargeAddNewViewModel viewModel)
        {
            InitializeComponent();
            DataContext = viewModel;
        }

        private void AutoSuggestBox_PreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
        }

        private void AutoSuggestBox_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            AutoSuggestBox box = (AutoSuggestBox)sender;
            if (e.OriginalSource is FrameworkElement { DataContext: var dataContext })
                box.SelectedItem = dataContext;
        }
    }
}